<?php
namespace app\user\validate\user;

use think\Validate;

/**
 * 个人主页验证
 */
class Home extends Validate
{
    /**
     * 定义验证规则
     * 格式：'字段名'    =>    ['规则1','规则2'...]
     *
     * @var array
     */
    protected $rule = [
        'user_id'       => 'require|number',
        'type'          => 'require|number|in:1,2,3,4',
    ];

    protected $field = [
        'user_id'       => '用户',
        'type'          => '课程类型',
    ];

    /**
     * 定义错误信息
     * 格式：'字段名.规则名'    =>    '错误信息'
     *
     * @var array
     */
    protected $message = [
    ];

    /**
     * 验证场景
     */
    protected $scene = [
        'base'          => ['user_id'],
        'circle'        => ['user_id'],
        'course'        => ['user_id', 'type'],
        'question'      => ['user_id'],
    ];

}
